.class public Lweibo4android/SearchResult;
.super Lweibo4android/WeiboResponse;
.source "SearchResult.java"

# interfaces
.implements Ljava/io/Serializable;


# static fields
.field private static final serialVersionUID:J = 0x722d7e8255df2773L


# instance fields
.field private createdAt:Ljava/util/Date;

.field private from_user:Ljava/lang/String;

.field private from_user_id:J

.field private id:J

.field private iso_language_code:Ljava/lang/String;

.field private profileImageUrl:Ljava/lang/String;

.field private source:Ljava/lang/String;

.field private text:Ljava/lang/String;

.field private to_user:Ljava/lang/String;

.field private to_user_id:J


# direct methods
.method public constructor <init>(Lweibo4android/org/json/JSONObject;)V
    .locals 2
    .parameter "json"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lweibo4android/WeiboException;,
            Lweibo4android/org/json/JSONException;
        }
    .end annotation

    .prologue
    .line 33
    invoke-direct {p0}, Lweibo4android/WeiboResponse;-><init>()V

    .line 34
    const-string v0, "created_at"

    invoke-virtual {p1, v0}, Lweibo4android/org/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    const-string v1, "EEE MMM dd HH:mm:ss z yyyy"

    invoke-static {v0, v1}, Lweibo4android/SearchResult;->parseDate(Ljava/lang/String;Ljava/lang/String;)Ljava/util/Date;

    move-result-object v0

    iput-object v0, p0, Lweibo4android/SearchResult;->createdAt:Ljava/util/Date;

    .line 35
    const-string v0, "to_user_id"

    invoke-virtual {p1, v0}, Lweibo4android/org/json/JSONObject;->getLong(Ljava/lang/String;)J

    move-result-wide v0

    iput-wide v0, p0, Lweibo4android/SearchResult;->to_user_id:J

    .line 36
    const-string v0, "to_user"

    invoke-virtual {p1, v0}, Lweibo4android/org/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lweibo4android/SearchResult;->to_user:Ljava/lang/String;

    .line 37
    const-string v0, "text"

    invoke-virtual {p1, v0}, Lweibo4android/org/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lweibo4android/SearchResult;->text:Ljava/lang/String;

    .line 38
    const-string v0, "source"

    invoke-virtual {p1, v0}, Lweibo4android/org/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lweibo4android/SearchResult;->source:Ljava/lang/String;

    .line 39
    const-string v0, "id"

    invoke-virtual {p1, v0}, Lweibo4android/org/json/JSONObject;->getLong(Ljava/lang/String;)J

    move-result-wide v0

    iput-wide v0, p0, Lweibo4android/SearchResult;->id:J

    .line 40
    const-string v0, "from_user_id"

    invoke-virtual {p1, v0}, Lweibo4android/org/json/JSONObject;->getLong(Ljava/lang/String;)J

    move-result-wide v0

    iput-wide v0, p0, Lweibo4android/SearchResult;->from_user_id:J

    .line 41
    const-string v0, "from_user"

    invoke-virtual {p1, v0}, Lweibo4android/org/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lweibo4android/SearchResult;->from_user:Ljava/lang/String;

    .line 42
    const-string v0, "iso_language_code"

    invoke-virtual {p1, v0}, Lweibo4android/org/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lweibo4android/SearchResult;->iso_language_code:Ljava/lang/String;

    .line 43
    const-string v0, "profile_image_url"

    invoke-virtual {p1, v0}, Lweibo4android/org/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lweibo4android/SearchResult;->profileImageUrl:Ljava/lang/String;

    .line 44
    return-void
.end method

.method public static constructResults(Lweibo4android/http/Response;)Ljava/util/List;
    .locals 8
    .parameter "res"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lweibo4android/http/Response;",
            ")",
            "Ljava/util/List",
            "<",
            "Lweibo4android/SearchResult;",
            ">;"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lweibo4android/WeiboException;
        }
    .end annotation

    .prologue
    .line 47
    invoke-virtual {p0}, Lweibo4android/http/Response;->asJSONObject()Lweibo4android/org/json/JSONObject;

    move-result-object v2

    .line 49
    .local v2, json:Lweibo4android/org/json/JSONObject;
    :try_start_0
    const-string v6, "results"

    invoke-virtual {v2, v6}, Lweibo4android/org/json/JSONObject;->getJSONArray(Ljava/lang/String;)Lweibo4android/org/json/JSONArray;

    move-result-object v3

    .line 50
    .local v3, list:Lweibo4android/org/json/JSONArray;
    invoke-virtual {v3}, Lweibo4android/org/json/JSONArray;->length()I

    move-result v5

    .line 51
    .local v5, size:I
    new-instance v4, Ljava/util/ArrayList;

    invoke-direct {v4, v5}, Ljava/util/ArrayList;-><init>(I)V

    .line 52
    .local v4, rt:Ljava/util/List;,"Ljava/util/List<Lweibo4android/SearchResult;>;"
    const/4 v0, 0x0

    .local v0, i:I
    :goto_0
    if-lt v0, v5, :cond_0

    .line 55
    return-object v4

    .line 53
    :cond_0
    new-instance v6, Lweibo4android/SearchResult;

    invoke-virtual {v3, v0}, Lweibo4android/org/json/JSONArray;->getJSONObject(I)Lweibo4android/org/json/JSONObject;

    move-result-object v7

    invoke-direct {v6, v7}, Lweibo4android/SearchResult;-><init>(Lweibo4android/org/json/JSONObject;)V

    invoke-interface {v4, v6}, Ljava/util/List;->add(Ljava/lang/Object;)Z
    :try_end_0
    .catch Lweibo4android/org/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    .line 52
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 59
    .end local v0           #i:I
    .end local v3           #list:Lweibo4android/org/json/JSONArray;
    .end local v4           #rt:Ljava/util/List;,"Ljava/util/List<Lweibo4android/SearchResult;>;"
    .end local v5           #size:I
    :catch_0
    move-exception v1

    .line 60
    .local v1, je:Lweibo4android/org/json/JSONException;
    new-instance v6, Lweibo4android/WeiboException;

    invoke-direct {v6, v1}, Lweibo4android/WeiboException;-><init>(Ljava/lang/Exception;)V

    throw v6
.end method


# virtual methods
.method public equals(Ljava/lang/Object;)Z
    .locals 7
    .parameter "obj"

    .prologue
    const/4 v1, 0x1

    const/4 v2, 0x0

    .line 123
    if-ne p0, p1, :cond_1

    .line 146
    :cond_0
    :goto_0
    return v1

    .line 125
    :cond_1
    if-nez p1, :cond_2

    move v1, v2

    .line 126
    goto :goto_0

    .line 127
    :cond_2
    invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v3

    invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v4

    if-eq v3, v4, :cond_3

    move v1, v2

    .line 128
    goto :goto_0

    :cond_3
    move-object v0, p1

    .line 129
    check-cast v0, Lweibo4android/SearchResult;

    .line 130
    .local v0, other:Lweibo4android/SearchResult;
    iget-object v3, p0, Lweibo4android/SearchResult;->from_user:Ljava/lang/String;

    if-nez v3, :cond_4

    .line 131
    iget-object v3, v0, Lweibo4android/SearchResult;->from_user:Ljava/lang/String;

    if-eqz v3, :cond_5

    move v1, v2

    .line 132
    goto :goto_0

    .line 133
    :cond_4
    iget-object v3, p0, Lweibo4android/SearchResult;->from_user:Ljava/lang/String;

    iget-object v4, v0, Lweibo4android/SearchResult;->from_user:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-nez v3, :cond_5

    move v1, v2

    .line 134
    goto :goto_0

    .line 135
    :cond_5
    iget-wide v3, p0, Lweibo4android/SearchResult;->from_user_id:J

    iget-wide v5, v0, Lweibo4android/SearchResult;->from_user_id:J

    cmp-long v3, v3, v5

    if-eqz v3, :cond_6

    move v1, v2

    .line 136
    goto :goto_0

    .line 137
    :cond_6
    iget-wide v3, p0, Lweibo4android/SearchResult;->id:J

    iget-wide v5, v0, Lweibo4android/SearchResult;->id:J

    cmp-long v3, v3, v5

    if-eqz v3, :cond_7

    move v1, v2

    .line 138
    goto :goto_0

    .line 139
    :cond_7
    iget-object v3, p0, Lweibo4android/SearchResult;->to_user:Ljava/lang/String;

    if-nez v3, :cond_8

    .line 140
    iget-object v3, v0, Lweibo4android/SearchResult;->to_user:Ljava/lang/String;

    if-eqz v3, :cond_9

    move v1, v2

    .line 141
    goto :goto_0

    .line 142
    :cond_8
    iget-object v3, p0, Lweibo4android/SearchResult;->to_user:Ljava/lang/String;

    iget-object v4, v0, Lweibo4android/SearchResult;->to_user:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-nez v3, :cond_9

    move v1, v2

    .line 143
    goto :goto_0

    .line 144
    :cond_9
    iget-wide v3, p0, Lweibo4android/SearchResult;->to_user_id:J

    iget-wide v5, v0, Lweibo4android/SearchResult;->to_user_id:J

    cmp-long v3, v3, v5

    if-eqz v3, :cond_0

    move v1, v2

    .line 145
    goto :goto_0
.end method

.method public getCreatedAt()Ljava/util/Date;
    .locals 1

    .prologue
    .line 67
    iget-object v0, p0, Lweibo4android/SearchResult;->createdAt:Ljava/util/Date;

    return-object v0
.end method

.method public getFromUser()Ljava/lang/String;
    .locals 1

    .prologue
    .line 91
    iget-object v0, p0, Lweibo4android/SearchResult;->from_user:Ljava/lang/String;

    return-object v0
.end method

.method public getFromUserId()J
    .locals 2

    .prologue
    .line 79
    iget-wide v0, p0, Lweibo4android/SearchResult;->from_user_id:J

    return-wide v0
.end method

.method public getId()J
    .locals 2

    .prologue
    .line 75
    iget-wide v0, p0, Lweibo4android/SearchResult;->id:J

    return-wide v0
.end method

.method public getName()Ljava/lang/String;
    .locals 1

    .prologue
    .line 99
    iget-object v0, p0, Lweibo4android/SearchResult;->iso_language_code:Ljava/lang/String;

    return-object v0
.end method

.method public getProfileImageURL()Ljava/net/URL;
    .locals 3

    .prologue
    .line 104
    :try_start_0
    new-instance v1, Ljava/net/URL;

    iget-object v2, p0, Lweibo4android/SearchResult;->profileImageUrl:Ljava/lang/String;

    invoke-direct {v1, v2}, Ljava/net/URL;-><init>(Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/net/MalformedURLException; {:try_start_0 .. :try_end_0} :catch_0

    .line 106
    :goto_0
    return-object v1

    .line 105
    :catch_0
    move-exception v0

    .line 106
    .local v0, ex:Ljava/net/MalformedURLException;
    const/4 v1, 0x0

    goto :goto_0
.end method

.method public getSource()Ljava/lang/String;
    .locals 1

    .prologue
    .line 86
    iget-object v0, p0, Lweibo4android/SearchResult;->source:Ljava/lang/String;

    return-object v0
.end method

.method public getText()Ljava/lang/String;
    .locals 1

    .prologue
    .line 83
    iget-object v0, p0, Lweibo4android/SearchResult;->text:Ljava/lang/String;

    return-object v0
.end method

.method public getToUser()Ljava/lang/String;
    .locals 1

    .prologue
    .line 95
    iget-object v0, p0, Lweibo4android/SearchResult;->to_user:Ljava/lang/String;

    return-object v0
.end method

.method public getToUserId()J
    .locals 2

    .prologue
    .line 71
    iget-wide v0, p0, Lweibo4android/SearchResult;->to_user_id:J

    return-wide v0
.end method

.method public hashCode()I
    .locals 9

    .prologue
    const/4 v3, 0x0

    const/16 v8, 0x20

    .line 111
    const/16 v0, 0x1f

    .line 112
    .local v0, prime:I
    const/4 v1, 0x1

    .line 114
    .local v1, result:I
    iget-object v2, p0, Lweibo4android/SearchResult;->from_user:Ljava/lang/String;

    if-nez v2, :cond_0

    move v2, v3

    .line 113
    :goto_0
    add-int/lit8 v1, v2, 0x1f

    .line 115
    mul-int/lit8 v2, v1, 0x1f

    iget-wide v4, p0, Lweibo4android/SearchResult;->from_user_id:J

    iget-wide v6, p0, Lweibo4android/SearchResult;->from_user_id:J

    ushr-long/2addr v6, v8

    xor-long/2addr v4, v6

    long-to-int v4, v4

    add-int v1, v2, v4

    .line 116
    mul-int/lit8 v2, v1, 0x1f

    iget-wide v4, p0, Lweibo4android/SearchResult;->id:J

    iget-wide v6, p0, Lweibo4android/SearchResult;->id:J

    ushr-long/2addr v6, v8

    xor-long/2addr v4, v6

    long-to-int v4, v4

    add-int v1, v2, v4

    .line 117
    mul-int/lit8 v2, v1, 0x1f

    iget-object v4, p0, Lweibo4android/SearchResult;->to_user:Ljava/lang/String;

    if-nez v4, :cond_1

    :goto_1
    add-int v1, v2, v3

    .line 118
    mul-int/lit8 v2, v1, 0x1f

    iget-wide v3, p0, Lweibo4android/SearchResult;->to_user_id:J

    iget-wide v5, p0, Lweibo4android/SearchResult;->to_user_id:J

    ushr-long/2addr v5, v8

    xor-long/2addr v3, v5

    long-to-int v3, v3

    add-int v1, v2, v3

    .line 119
    return v1

    .line 114
    :cond_0
    iget-object v2, p0, Lweibo4android/SearchResult;->from_user:Ljava/lang/String;

    invoke-virtual {v2}, Ljava/lang/String;->hashCode()I

    move-result v2

    goto :goto_0

    .line 117
    :cond_1
    iget-object v3, p0, Lweibo4android/SearchResult;->to_user:Ljava/lang/String;

    invoke-virtual {v3}, Ljava/lang/String;->hashCode()I

    move-result v3

    goto :goto_1
.end method

.method public toString()Ljava/lang/String;
    .locals 3

    .prologue
    .line 152
    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "Result{ "

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-wide v1, p0, Lweibo4android/SearchResult;->to_user_id:J

    invoke-virtual {v0, v1, v2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 153
    const-string v1, ","

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, p0, Lweibo4android/SearchResult;->to_user:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 154
    const-string v1, ","

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, p0, Lweibo4android/SearchResult;->text:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 155
    const-string v1, ","

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-wide v1, p0, Lweibo4android/SearchResult;->id:J

    invoke-virtual {v0, v1, v2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 156
    const-string v1, ","

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-wide v1, p0, Lweibo4android/SearchResult;->from_user_id:J

    invoke-virtual {v0, v1, v2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 157
    const-string v1, ","

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, p0, Lweibo4android/SearchResult;->from_user:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 158
    const-string v1, ","

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, p0, Lweibo4android/SearchResult;->iso_language_code:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 159
    const-string v1, ","

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, p0, Lweibo4android/SearchResult;->source:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 160
    const-string v1, ","

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, p0, Lweibo4android/SearchResult;->profileImageUrl:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 161
    const-string v1, ","

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, p0, Lweibo4android/SearchResult;->createdAt:Ljava/util/Date;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 162
    const/16 v1, 0x7d

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 152
    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method
